package com.hcms.common.customtag.menua;


import org.springframework.stereotype.Component;
import org.thymeleaf.dialect.AbstractProcessorDialect;
import org.thymeleaf.processor.IProcessor;
import org.thymeleaf.standard.StandardDialect;

import java.util.HashSet;
import java.util.Set;

// 自定义标签注册类
// 权限按钮 a 链接
@Component
public class MenuATagDialect extends AbstractProcessorDialect {

    // 定义方言名称
    private static final String NAME = "系统自定义标签";

    // 定义方言属性
    private static final String PREFIX = "Menu";

    protected MenuATagDialect() {
        super(NAME, PREFIX, StandardDialect.PROCESSOR_PRECEDENCE);
    }

    @Override
    public Set<IProcessor> getProcessors(final String dialectPrefix) {
        final Set<IProcessor> processor = new HashSet<>();
        // <Menu:a> 标签
        processor.add(new MenuATagProcessor(PREFIX));
        return processor;
    }
}
